//package com.douya.pangu.application.sys.service;
//
//import com.alibaba.fastjson.JSON;
//import com.douya.pangu.core.api.constant.CoreConsumerConstant;
//import org.apache.rocketmq.client.consumer.DefaultMQPullConsumer;
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener;
//import org.springframework.stereotype.Component;
//
///**
// * 说明：
// *
// * @author 胡晨烨
// * @date 2023/1/2
// */
//@Component
//@RocketMQMessageListener(
//        consumeThreadMax = 100,
//        consumerGroup = CoreConsumerConstant.PAN_GU_CORE_GROUP,
//        topic = CoreConsumerConstant.CoreConsumerTopicConstant.PAN_GU_CORE_TOPIC
//)
//public class PanGuCoreTopicConsumer implements RocketMQListener<String>,
//        RocketMQPushConsumerLifecycleListener {
//
//    @Override
//    public void onMessage(String message) {
//        String name = Thread.currentThread().getName();
//        System.out.println(name + "线程,消息: " + message);
//    }
//
//    @Override
//    public void prepareStart(DefaultMQPushConsumer consumer) {
//        String consumerGroup = consumer.getConsumerGroup();
//        ConsumeFromWhere consumeFromWhere = consumer.getConsumeFromWhere();
//        System.out.println("消费者组: " + consumerGroup + ",消费位置: " + JSON.toJSONString(consumeFromWhere));
//    }
//}